Route statistics and information about service class categories
Retrieves information about the cost of the ride with various tariffs and creates a ride offer. It retrieves route point coordinates routes, employee ID user_id, additional requirements requirements. If user_id is passed and route contains more than 2 points, it should return an offer that will then be passed to an order creation request.
Request syntax
POST https://b2b-api.go.yandex.ru/integration/2.0/orders/routestats
Request headers
Authorization: Bearer <OAuth-token>
OAuth access token. The steps to get a token are described in Getting started.
X-YaTaxi-Selected-Corp-Client-Id— client ID from the account. Required if multiple clients are available using the token.
Accept-Language: set language as a string (ru, en, fr, hy, he, etc.)
Request body
Data is passed in the request body in JSON format:
|
Field |
Description |
Format |
Required |
|
|
Information about the route. The coordinates are provided as follows:
|
Array |
Yes |
|
|
A list of requirements for the ride. May vary depending on the city. To learn about the supported requirements, use the GET /zoneinfo request. The response will contain an array |
Object |
No |
|
|
Employee ID. |
String |
No |
|
|
The ability to use toll roads. Default value: |
Boolean |
No |
Response fields description
The response may contain the following fields:
| Field | Description | Format |
|---|---|---|
offer |
Offer ID. | String |
service_levels |
A list of tariffs with their descriptions. | Array of objects |
toll_roads |
Toll roads. | Object |
Structure of the service_levels array element:
| Field | Description | Format |
|---|---|---|
class |
Tariff category. | String |
is_fixed_price |
Determines if the price is fixed. | Boolean |
price |
Approximate cost of the ride. | String |
estimated_waiting |
Estimated waiting time. | Array of objects |
details_tariff |
Description of the components of the minimal tariff. | Array of objects |
Structure of the estimated_waiting array element:
| Field | Description | Format |
|---|---|---|
seconds |
Waiting time in seconds. | Number |
message |
Time as a text. | String |
Structure of the details_tariff array element:
| Field | Description | Format |
|---|---|---|
type |
Component type. | String |
value |
Component description. | String |
type_details |
Details about the component type (for example, option name). | String |
Structure of the toll_roads object:
| Field | Description | Format |
|---|---|---|
has_tolls |
The presence of toll roads in the route. | Boolean |
auto_payment |
Automatic deduction of tolls. Returned true if the toll road is available for autopayment and the option to pay for toll roads is enabled for the client. |
Boolean |
Request example
POST https://b2b-api.go.yandex.ru/integration/2.0/orders/routestats
...
Authorization: Bearer <OAuth-token>
X-YaTaxi-Selected-Corp-Client-Id: <client-id>
{
"route": [
[ 37.593983,
55.738759
],
[
37.609479,
55.746943
]
],
"user_id": "035...3c71",
"use_toll_roads": true,
"requirements": {
"conditioner": true,
"yellowcarnumber": true
}
}
Response example
An example response to this request looks like this:
{
"offer": "06f...f7da",
"service_levels": [
{
"class": "comfortplus",
"is_fixed_price": true,
"price": "290 RUB",
"details_tariff": [
{
"type": "price",
"value": "from 219 RUB"
},
{
"type": "icon",
"value": "from 219 RUB"
},
{
"type": "comment",
"value": "5 min included, 14.3 RUB/min afterwards"
},
{
"type": "comment",
"value": "0 km included, 14.3 RUB/km afterwards"
}
]
},
{
"class": "cargo",
"is_fixed_price": true,
"price": "1120 RUB",
"estimated_waiting": {
"seconds": 300,
"message": "5 min"
},
"details_tariff": [
{
"type": "price",
"value": "from 1044 RUB"
},
{
"type": "icon",
"value": "from 1044 RUB"
},
{
"type": "comment",
"value": "5 min included, 14.3 RUB/min afterwards"
},
{
"type": "comment",
"value": "0 km included, 14.3 RUB/km afterwards"
}
]
},
{
"class": "econom",
"is_fixed_price": true,
"price": "250 RUB",
"estimated_waiting": {
"seconds": 240,
"message": "4 min"
},
"details_tariff": [
{
"type": "price",
"value": "from 166 RUB"
},
{
"type": "icon",
"value": "from 166 RUB"
},
{
"type": "comment",
"value": "2 min included, 9.9 RUB/min afterwards"
},
{
"type": "comment",
"value": "1 km included, 9.9 RUB/km afterwards"
}
]
},
{
"class": "maybach",
"is_fixed_price": true,
"price": "2030 RUB",
"estimated_waiting": {
"seconds": 240,
"message": "4 min"
},
"details_tariff": [
{
"type": "price",
"value": "from 1100 RUB"
},
{
"type": "icon",
"value": "from 1100 RUB"
},
{
"type": "comment",
"value": "1 min included, 110 RUB/min afterwards"
},
{
"type": "comment",
"value": "1 km included, 110 RUB/km afterwards"
}
]
},
{
"class": "express",
"is_fixed_price": true,
"price": "210 RUB",
"estimated_waiting": {
"seconds": 300,
"message": "5 min"
},
"details_tariff": [
{
"type": "price",
"value": "from 175 RUB"
},
{
"type": "icon",
"value": "from 175 RUB"
},
{
"type": "comment",
"value": "5 min included, 9,9 RUB/min afterwards"
},
{
"type": "comment",
"value": "3 km included, 11 RUB/km afterwards"
}
]
},
{
"class": "business",
"is_fixed_price": true,
"price": "260 RUB",
"estimated_waiting": {
"seconds": 240,
"message": "4 min"
},
"details_tariff": [
{
"type": "price",
"value": "from 219 RUB"
},
{
"type": "icon",
"value": "from 219 RUB"
},
{
"type": "comment",
"value": "5 min included, 13,2 RUB/min afterwards"
},
{
"type": "comment",
"value": "2 km included, 13,2 RUB/km afterwards"
}
]
},
{
"class": "child_tariff",
"is_fixed_price": true,
"price": "180 RUB",
"details_tariff": [
{
"type": "price",
"value": "from 109 RUB"
},
{
"type": "icon",
"value": "from 109 RUB"
},
{
"type": "comment",
"value": "1 min included, 12,1 RUB/min afterwards"
},
{
"type": "comment",
"value": "2 km included, 12,1 RUB/km afterwards"
}
]
},
{
"class": "vip",
"is_fixed_price": true,
"price": "230 RUB",
"details_tariff": [
{
"type": "price",
"value": "from 110 RUB"
},
{
"type": "icon",
"value": "from 110 RUB"
},
{
"type": "comment",
"value": "pickup,"
},
{
"type": "comment",
"value": "11 RUB/km and 12.1 RUB/min afterwards"
}
]
},
{
"class": "ultimate",
"is_fixed_price": true,
"price": "120 RUB",
"details_tariff": [
{
"type": "price",
"value": "from 110 RUB"
},
{
"type": "icon",
"value": "from 110 RUB"
},
{
"type": "comment",
"value": "pickup,"
},
{
"type": "comment",
"value": "1.1 RUB/km and 1.1 RUB/min afterwards"
}
]
}
],
"toll_roads": {
"has_tolls": true,
"auto_payment": false
}
}
Response codes
The response to this request may contain the following HTTP codes:
200: Request completed successfully.400: Request contained an unknown parameter or a parameter with an invalid value.403:- SELECT_CLIENT_HEADER_REQUIRED: the request did not pass the header
X-YaTaxi-Selected-Corp-Client-Id(returned if more than one client is available for the token). - SELECTED_CLIENT_ACCESS_DENIED: the header
X-YaTaxi-Selected-Corp-Client-Idcontains the client's ID, which this login does not have access to.
- SELECT_CLIENT_HEADER_REQUIRED: the request did not pass the header
404: Area not found.